#pragma once
#include "autoricheditctrl.h"
#include "afxcmn.h"
#include "afxwin.h"
#include "MyToolbar.h"
#include "SwordBibleFonts.h"
#include "RangeSet.h"

// CGenBooks dialog

class CGenBooks : public CPropertyPage
{
	DECLARE_DYNAMIC(CGenBooks)

public:
	CGenBooks();
	virtual ~CGenBooks();
	int LoadToolbar(void);

// Dialog Data
	enum { IDD = IDD_GENBOOKS };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	CMyToolBar m_wndFormatBar;
	CAutoRichEditCtrl m_rich;
	CTreeCtrl m_tree;
	CImageList m_image ; // member variable to hold the image list
	sword::SWModule* pModule;
	static int active;
	static CString ActiveMainFrameCommand;
	static CSwordBibleFonts font;
	CString chapText;
	CString tempStr;
  CRangeSet tips;

	virtual BOOL OnInitDialog();
	
	void PopulateTree();
  void AddTreeItem(HTREEITEM item);	// Add a child item or sibling
	void ShowChapter();
	void ZoomText();
	void OnRightButtonDown();
  void CreateTips();



	BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR,   LRESULT *pResult);
	LONG OnMainFrameCommand(UINT, LONG);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnShowVersions();
	afx_msg void OnPrint();
	afx_msg void OnCopy();
	afx_msg void OnSelectAll();
	afx_msg void OnFont();
	afx_msg void OnZoom();
	afx_msg void OnUpdateZoom(CCmdUI *pCmdUI);
	afx_msg void OnPrevious();
	afx_msg void OnNext();	
  afx_msg void OnInfo();
  afx_msg void OnSearch();
	afx_msg void OnEnMsgfilterGenbooks(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult);
};
